/* - DSC3D content checking not enforced */

#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif

#include "triangulation.h"

int main(int argc, char **argv) {
	
	char str[512];
	
	if (argc < 2) {
		cout << "Enter the filename or the directory (\".\" for current directory) : ";
		/* DOES NOT HANDLE SPACES */
		cin >> str;
		if (strcmp(str, ".") == 0) {
			_getcwd(str, 512);
			convert_dir(str);
		}
		else if (strstr(str, ":\\") != NULL) {
			if (_chdir(str) == -1) {
				cout << "Not a valid path." << endl;
				exit(-1);
			}
			convert_dir(str);
		}
		else convert(str);
	}
	else convert(argv[1]);
		
	return 0;
}